package com.xu.book.service.impl;

import com.xu.book.bean.BookType;
import com.xu.book.dao.IBookTypeDao;
import com.xu.book.dao.impl.BookTypeDaoimpl;
import com.xu.book.service.IBookTypeService;
import com.xu.sys.utils.PageUtils;

import java.util.List;

public class BookTypeServiceimpl implements IBookTypeService {
    private IBookTypeDao dao = new BookTypeDaoimpl();
    @Override
    public void listPage(PageUtils pageUtils) {
        List<BookType> bookTypes = dao.listPage(pageUtils);
        int count = dao.count(pageUtils);
        pageUtils.setList(bookTypes);
        pageUtils.setTotalCount(count);
    }

    @Override
    public int count(PageUtils pageUtils) {
        return dao.count(pageUtils);
    }

    @Override
    public List<BookType> list() {
        return dao.list();
    }

    @Override
    public int save(BookType entity) {
        return dao.save(entity);
    }

    @Override
    public BookType findById(int id) {
        return dao.findById(id);
    }

    @Override
    public int updateById(BookType entity) {
        return dao.updateById(entity);
    }

    @Override
    public int deleteById(int id) {
        return dao.deleteById(id);
    }
}
